From 38b939b2e991795a06ec4db35e2eb84e4d27cd16 Mon Sep 17 00:00:00 2001 From: Charles Lombardo Date: Mon, 25 Sep 2023 17:58:26 -0400 Subject: android: Prevent nav bar shade from laying out across screen --- .../org/yuzu/yuzu_emu/features/settings/ui/SettingsActivity.kt | 10 ++++++---- src/android/app/src/main/res/layout/activity_settings.xml | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivity.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivity.kt index 4d2f2f604..ea26a21d0 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivity.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivity.kt @@ -181,12 +181,14 @@ class SettingsActivity : AppCompatActivity() { private fun setInsets() { ViewCompat.setOnApplyWindowInsetsListener( binding.navigationBarShade - ) { view: View, windowInsets: WindowInsetsCompat -> + ) { _: View, windowInsets: WindowInsetsCompat -> val barInsets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars()) - val mlpShade = view.layoutParams as MarginLayoutParams - mlpShade.height = barInsets.bottom - view.layoutParams = mlpShade + // The only situation where we care to have a nav bar shade is when it's at the bottom + // of the screen where scrolling list elements can go behind it. + val mlpNavShade = binding.navigationBarShade.layoutParams as MarginLayoutParams + mlpNavShade.height = barInsets.bottom + binding.navigationBarShade.layoutParams = mlpNavShade windowInsets } diff --git a/src/android/app/src/main/res/layout/activity_settings.xml b/src/android/app/src/main/res/layout/activity_settings.xml index 8a026a30a..a187665f2 100644 --- a/src/android/app/src/main/res/layout/activity_settings.xml +++ b/src/android/app/src/main/res/layout/activity_settings.xml @@ -22,7 +22,7 @@